function http(url){
  return new Promise((resolve,reject)=>{
    wx.request({
      url,
      dataType: "json",
      header: {"content-type":"application"},
      method: "GET",
      responseType: "text",
      success: (res) => {resolve(res)},
      fail: (err) => {reject(err)}
    })
  })
}

function getMusicUrl(){
  return http("http://47.108.197.28:3000/top/playlist")
}

function getMvUrl(){
  return http("http://47.108.197.28:3000/mv/first")
}

function getBookUrl(){
  return http("http://47.108.197.28:8000/cart")
}

module.exports = {
  getMusicUrl,
  getMvUrl,
  getBookUrl
}